<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
<if condition="$_GET['news_category'] eq 1">干货分享
<elseif condition="$_GET['news_category'] eq 2"/>公会活动
<elseif condition="$_GET['news_category'] eq 3"/>人才共享
<elseif condition="$_GET['news_category'] eq 4"/>HR大明星
<elseif condition="$_GET['news_category'] eq 5"/>视频里的公会
</if>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0 maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="__PUBLIC__/weixin/style/reset.css?ver=1">
<link rel="stylesheet" href="__PUBLIC__/weixin/style/loading.css?ver=1">
<!--瀑布流-->
<link rel="stylesheet" href="__PUBLIC__/Css/pwall.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/jquery.masonry.min.js"></script>

</head>
<body style="background-color:#ededed">
<div class="share_bgc">
    <div id="head">
        <img id="bg"   src="__PUBLIC__/weixin/images/top-bg_02.png" alt="">
        <img id="logo" src="__PUBLIC__/weixin/images/HRLOGO.png" 	alt="">
        <img id="line" src="__PUBLIC__/weixin/images/top-line.png" 	alt="">
        <p style="font-size:20px"><if condition="$_GET['news_category'] eq 1">干货分享
        <elseif condition="$_GET['news_category'] eq 2"/>公会活动
        <elseif condition="$_GET['news_category'] eq 3"/>人才共享
        <elseif condition="$_GET['news_category'] eq 4"/>HR大明星
        <elseif condition="$_GET['news_category'] eq 5"/>视频里的公会
        </if></p>
    </div>
    <div class="center_share" id="container">
        <ul id="thelist" data="10">
            <script>var j=0;</script>
        	<volist name="rs" id="val">
            <div class="imgBox" style="width:100%;">
            <a id="list_a" href="<php>echo C('DOMAIN_NAME').__ROOT__</php>/{$val.news_url}" >
            <script>
				if(j==0){
						document.write("<li class='li_top'>");
				}else if(j=='{$count}'){
						document.write("<li class='li_bottom'>");
				}else{
					document.write("<li>");	
				}			
			</script>
            <if condition="$val.news_image_s != ''">
            <img class="li_top_img" src="__ROOT__/{$val.news_image_s}" style="min-height:60px; min-width:60px" alt="" />
            <else/>
            <img class="li_top_img" src="<php>echo C('DOMAIN_NAME').__ROOT__.'/Public/weixin/images/list_'.$_GET['news_category'].'.jpg'</php>" style="min-height:60px; min-width:60px" alt="">
            </if>
                
                <h1 style="font-size:15px">{$val.news_title}</h1>
                <h2>
                    <img src="__PUBLIC__/weixin/images/list/seen.png" alt="">{$val.news_readNum}
                    <img src="__PUBLIC__/weixin/images/list/shared.png" alt="">{$val.news_shareNum}
                </h2>
            </li>
            </a>
            <script>j++;</script>
            </div>
            </volist>
        </ul>
    </div>
   	 	<div style="clear:both;"></div>
        <if condition="$count gt 10">
        	<div id="more" style="text-align:center;background:#666;font-size:16px;cursor:pointer;width:94%;height:30px; margin-left:3%;line-height:28px;margin-top:10px;"><a id="loadmore_a" href="javascript:void(0);">更多...</a></div>
        <else />
        
        </if>
        <if condition="$_GET['news_category'] eq 1"><img id="pass_bo" src="__PUBLIC__/weixin/images/xz.png" alt="">
        <elseif condition="$_GET['news_category'] eq 2"/><img id="pass_bo" src="__PUBLIC__/weixin/images/ghhd.png" alt="">
        <elseif condition="$_GET['news_category'] eq 3"/><img id="pass_bo" src="__PUBLIC__/weixin/images/rcgx.png" alt="">
        <elseif condition="$_GET['news_category'] eq 4"/><img id="pass_bo" src="__PUBLIC__/weixin/images/hr.png" alt="">
        <elseif condition="$_GET['news_category'] eq 5"/><img id="pass_bo" src="__PUBLIC__/weixin/images/spldgh.png" alt="">
        </if>
</div>
</body>
</html>
<script>
document.addEventListener("WeixinJSBridgeReady",function() {
	WeixinJSBridge.call("hideToolbar");
});
</script>
<script type="text/javascript">
var $container = $('#container');

loadimg();

$("#more").click(function(){
	var total_count=parseInt('{$count}'),
		currnet_count = parseInt($('#thelist').attr('data'));
		if(currnet_count>=total_count){
			$('#more').hide();
			return;
		}
		$.ajax({
			type:'post',
			url:'__URL__/loadmore',
			data:'currnet_count='+currnet_count+'&news_category={$news_category}',
			dataType:'html',
			success:function(data)
			{
				$('#thelist').attr('data',currnet_count+3);
				currnet_counts = parseInt($('#thelist').attr('data'));
				var $boxes = $(data);
				$container.append($boxes).masonry('appended',$boxes);
				$container.find("div.imgBox:hidden").fadeIn('slow');
				loadimg();
				if(currnet_counts>=total_count){
					$('#more').hide();
					return;
				}
			}	
		});
	
});
				
//该方法在图片加载完成后调用,让js将加载的图片重新排版样式
function loadimg(){
	$container.imagesLoaded(function(){	
		$container.masonry({
			itemSelector: '.imgBox',
			columnWidth: parseInt($container.css('width')) / 4 ,
			animationOptions : {
				duration: 750,
				easing: 'linear',
				queue: false
			}
		});
	});	
}
</script>
